<template>
	<view>
		<view style="display: flex;justify-content: center;height: 200upx;align-items: center;font-size:50upx;font-weight: bold;">
			{{carNum}}
		</view>
		<view style="display: flex;justify-content: center;">
			<uqrcode ref="uqrcode"></uqrcode>
		</view>
		
	</view>
</template>

<script>
import { mapState } from 'vuex';
	export default {
		data() {
			return {
				carNum:""
			}
		},
		methods: {
			
		},
		computed: {
			...mapState('account', ['token', 'userInfo'])
		},
		onLoad() {
			uni.showLoading({
				title:'二维码生成中'
			})
			setTimeout(()=>{
				this.carNum = uni.getStorageSync("car-order-detail-num")
				let data = {
					carNum:uni.getStorageSync("car-order-detail-num")
				}
				this.$refs
				    .uqrcode
				    .make({
				        size: 300,
				        text: JSON.stringify(data)
				    })
				    .then(res => {
				        // 返回的res与uni.canvasToTempFilePath返回一致
				        console.log(res)
				    })
						uni.hideLoading()
			},1000)
		}
	}
</script>

<style>

</style>
